import { fromJS } from "immutable"
import * as constants from './constants'


const defaultState = fromJS({
    loginState: false
})

export default (state = defaultState, action) => {
    switch (action.type) {
        case constants.LOGIN_OUT:
            return state.set('loginState', action.loginState)
        case constants.LOGIN_IN:
            return state.set('loginState', action.loginState)
        default:
            return state
    }
}